package com.cus.tom.transfer.vm

import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.snap.base.ktx.startAgreement
import com.snap.base.ktx.startFeedback
import com.snap.base.ktx.startPrivacy
import com.snap.common.main.BaseVM
import com.snap.base.util.BaseUtil
import com.snap.util.appVerName
import kotlinx.coroutines.launch

class MeVM : BaseVM() {

    lateinit var actionAct: () -> FragmentActivity

    val versionName = MutableLiveData<String>().apply {
        value = "当前版本$appVerName"
    }

    fun clickAsk() = BaseUtil.startFeedback()

    fun startAgreement() = BaseUtil.startAgreement()

    fun startPrivacy() = BaseUtil.startPrivacy()

    lateinit var actionUpdate: suspend () -> Unit

    fun clickVersion() {
        viewModelScope.launch {
            actionUpdate.invoke()
        }
    }

    fun clickEmail() {
        BaseUtil.copyEmail("hfldygkj@163.com")
    }

}